<html>
<head>
<title>管理系统</title>
<meta http-equiv=Content-Type content=text/html;charset=utf-8>
<#include "/xadmin/inc/common.html">
<script language="JavaScript">
	var grid;
	$(function() {
		//分类管理表格  
		grid = $('#usergrid').datagrid({
         url:'usermanage-listuser',  
         loadMsg:'数据加载中请稍后……',  
         striped: true,  
         singleSelect : true,  
         pagination: true,  
         rownumbers: true, 
         pageSize: [${syscfg.pageSize!10}],
         pageList: [${syscfg.pageList!10}],
         columns:[[  
             {field:'userid',title: '用户ID',align: 'center',width: '50'},  
             {field:'username',title: '用户名称',align: 'center',width: '100'},
             {field:'fullname',title: '真实姓名',align: 'center',width: '100'},
             {field:'depname',title: '所在部门',align: 'center',width: '100'},
             {field:'oskeyname',title: '权限',align: 'center',width: '100'},
             {field:'tel',title: '电话',align: 'center',width: '150'},
             {field:'useremail',title: '邮箱',align: 'center',width: '200'},
             {field:'lastlogin',title: '最后登录时间',align: 'center',width: '170'},
         ]],
         toolbar : '#toolbar'
     });
		//
		$("#tree").tree({
		    method: "post",
		    lines: true,
		    url: "deptmanage-listdeptfortree",
		    dataPlain: true,       //该属性用以启用当前 easyui-tree 控件对平滑数据格式的支持
		    toggleOnClick: false,
		    enableContextMenu: false,
		    onClick: function(node){
		        var params = {};
		        windowparam = node.id;
				params['deptid'] = node.id;
				grid.datagrid('reload',params); 
			}
		});
  });
	//刷新
	function restore(){
		$('#toolbar input').val('');
		grid.datagrid('reload',{});
	}
	//搜索
	function dosearch(){
		var params = {};
		if($('#username').val()){
			params['username'] = $('#username').val();
		}
		if($('#fullname').val()){
			params['fullname'] = $('#fullname').val();
		}
		if($('#oskey').combobox('getValue')){
			params['oskey'] = $('#oskey').combobox('getValue');
		}
		grid.datagrid('reload',params);
	}
</script>

</head>
<body class="easyui-layout">
<div data-options="region:'west',iconCls:'icon-mini-add',title:'按部门查看',split:true" style="width:180px;">
	<div class="easyui-panel" data-options='fit:true,border:false'> 
		<ul id="tree"></ul>
	</div>
</div>   
<div data-options="region:'center'">
<table id="usergrid" data-options="fit:true,border:false"></table>
</div>  
	
	<div id="toolbar" style="display: none;">
		<table>
			<tr >
				<td valign="center">
					用户名：
					<input class="easyui-validatebox" type="text" id="username" name="username" maxlength="30" style="width:150px;">
				</td>
				<td valign="center">
					真实姓名 ： 
					<input class="easyui-validatebox" type="text" id="fullname" name="fullname" maxlength="30" style="width:150px;">
				</td>
				<td valign="center">
					权限 ：
					<input id="oskey" class="easyui-combobox" name="oskey" style="width:150px;" data-options="valueField:'jsdm',textField:'jsmc',url:'${request.contextPath}/xadmin/system/qxmanage-listrole'" />
				</td>
				<td valign="center">	
					<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true" onclick="dosearch();">搜索</a>
				</td>
				<td valign="center">
					<div class="datagrid-btn-separator"></div>
				</td>
				<td valign="center">
					<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true" onclick="restore();">刷新</a>
				</td>
				<td valign="center">
					<div class="datagrid-btn-separator"></div>
				</td>
			</tr>
		</table>
	</div>
</body>
</html>